Last update: April 2015
command.cgi allows external devices such as smartphones and PCs to get and edit information in the FlashAir via Wireless LAN.
command.cgi uses the
CGI (Common Gateway
Interface)
system, so that external devices may execute the command while connected to the FlashAir by sending
an HTTP
GET request to:
http://flashair/command.cgi?<parameter>
The following is a list of operations available using command.cgi:
Function | Parameter Example | Firmware Version |
---|---|---|
Get file list |
op=100&DIR=/DCIM
|
1.00.00+ |
Get the number of files |
op=101&DIR=/DCIM
|
1.00.00+ |
Get update status |
op=102
|
1.00.00+ |
Get SSID |
op=104
|
1.00.00+ |
Get network password |
op=105
|
1.00.00+ |
Get MAC address |
op=106
|
1.00.00+ |
Get browser language |
op=107
|
1.00.00+ |
Get the firmware version |
op=108
|
1.00.00+ |
Get the control image |
op=109
|
2.00.00+ |
Get Wireless LAN mode |
op=110
|
2.00.00+ |
Get Wireless LAN timeout length |
op=111
|
2.00.00+ |
Get application unique information |
op=117
|
2.00.00+ |
Get Upload parameters |
op=118
|
2.00.02+ |
Get CID |
op=120
|
1.00.03+ |
Get time stamp of write event |
op=121
|
2.00.02+ |
Get data from shared memory |
op=130&ADDR=0&LEN=8
|
2.00.00+ |
Set data to shared memory |
op=131&ADDR=0&LEN=8&DATA=0123ABCD
|
2.00.00+ |
Get the number of empty sectors |
op=140
|
1.00.03+ |
Control SD Interface as user I/O |
op=190&CTRL=0x1f&DATA=0x1f
|
2.00.03+ |
Enable Photo Share mode |
op=200&DIR=/DCIM/100__TSB&DATE=17153
|
2.00.00+ |
Disable Photo Share mode |
op=201
|
2.00.00+ |
Get Photo Share mode status |
op=202
|
2.00.00+ |
Get SSID for Photo Share mode |
op=203
|
2.00.00+ |
Get FlashAir Drive(WebDAV) information |
op=220
|
3.00.00+ |
Get timezone |
op=221
|
3.00.00+ |
(op=100)
Returns a list of files in a specified directory.
DIR
Path to the directory
http://flashair/command.cgi?op=100&DIR=/DCIM
Each row of the list is returned in the following format.
<directory>, <filename>, <size>, <attribute>, <date>, <time>
WLANSD_FILELIST
/DCIM,100__TSB,0,16,9944,129
/DCIM,0126_1.jpg,70408,32,17071,28040
Please remind that file names may contain commas (
,
) if you parse a response.
If DIR=/ (root) is specified, directory name will be empty.
<directory>
<filename>
<size>
<attribute>
<date>
<time>
Attribute
is specified in decimal 16-bit integer in the following formats:
Date
is specified in decimal 16-bit integer in the following formats:
Time
is specified in decimal 16-bit integer in the following formats:
This operation is available in Firmware Versions 1.00.00+
(op=101)
Returns the number of files in a specified directory.
http://flashair/command.cgi?op=101&DIR=/DCIM
2
This operation is available in Firmware Versions 1.00.00+
(op=102)
Returns whether the FlashAir memory has been updated. Returns
1
if memory has been updated,
0
if not. Once this command is called, the status will be cleared.
http://flashair/command.cgi?op=102
1
This operation is available in Firmware Versions 1.00.00+
(op=104)
Returns the SSID of the FlashAir (32 character maximum)
http://flashair/command.cgi?op=104
flashair_e8e0b756a7fb
This operation is available in Firmware Versions 1.00.00+
(op=105)
Returns the network key (63 character maximum) when the FlashAir is in AP mode. If the network key was set on an SD host device such as a cooperative digital camera, this command will not display the network password.
http://flashair/command.cgi?op=105
12345678
This operation is available in Firmware Versions 1.00.00+
(op=106)
Returns the MAC address of the client that issued the request.
http://flashair/command.cgi?op=106
a41731f4d880
This operation is available in Firmware Versions 1.00.00+
(op=107)
Returns the Accept-Language parameter from your browser language settings.
http://flashair/command.cgi?op=107
Accept-Language: ja,en-US;q=0.8,en;q=0.6
This operation is available in Firmware Versions 1.00.00+
(op=108)
Returns the firmware version of the FlashAir card. Versions that start with F24 are type 1.00 for the W-01 card. Versions that start with F19 are type 2.00 for the W-02 card.
http://flashair/command.cgi?op=108
F19BAW3AW2.00.00
This operation is available in Firmware Versions 1.00.00+
(op=109)
Get the full-path of the image to use as the wireless boot screen. The wireless boot screen is an image file that controls whether the Wireless LAN is ON or OFF when the Wireless LAN mode (APPMODE) is 0, 2, or 3.
To learn more about CIPATH, refer to the article regarding CIPATH in the CONFIG section.
http://flashair/command.cgi?op=109
/DCIM/100__TSB/FA000001.JPG
This operation is available in Firmware Versions 2.00.00+
(op=110)
Returns the current Wireless LAN mode (APPMODE). To learn more about APPMODE, refer to the article regarding APPMODE in the CONFIG section.
http://flashair/command.cgi?op=110
4
This operation is available in Firmware Versions 2.00.00+
(op=111)
Returns the automatic time-out period (in milliseconds) after which the FlashAir will stop its Wireless LAN functionality if it is not being connected to. Available only when Wireless LAN mode is in Auto boot AP mode. To learn more about APPAUTOTIME, refer to the article regarding APPAUTOTIME in the CONFIG section.
http://flashair/command.cgi?op=111
300000
This operation is available in Firmware Versions 2.00.00+
(op=117)
Get 16 characters uniquely used by the application. To learn more about APPINFO, refer to the article regarding APPINFO in the CONFIG section.
http://flashair/command.cgi?op=117
0123ABCD4567EFGH
This operation is available in Firmware Versions 2.00.00+
(op=118)
Get the parameters currently set for Uploading. To learn more about UPLOAD, refer to the article regarding UPLOAD in the CONFIG section.
1 | Uploading is enabled. |
---|---|
Other | Uploading is disabled. |
http://flashair/command.cgi?op=118
1
This operation is available in Firmware Versions 2.00.02+
(op=120)
Returns the CID designated by the SD specification. The CID is consists of 32 hexadecimal digits that are unique to each SD card.
http://flashair/command.cgi?op=120
02544d535730384708c00b78700d201
This operation is available in Firmware Versions 1.00.03+
(op=121)
Returns the internal time stamp of when a write event occurred. A Write event occurs, for example, when you Drag & Drop a file onto the FlashAir using Windows Explore. The time stamp indicates the number of milliseconds since the card has been running.
http://flashair/command.cgi?op=121
174428
This operation is available in Firmware Versions 2.00.02+
(op=130)
Gets data from shared memory. It uses CMD48: Read Extension Register Single Block Command, a command specified by the SD standard.
Returns
SUCCESS
if the command succeeded. If not, it returns
400 Bad Request
.
http://flashair/command.cgi?op=130&ADDR=0&LEN=8
0-511
or
0x0-0x1FF
.0-512
or
0x0-0x200
.
0123ABCD
This operation is available in Firmware Versions 2.00.00+
(op=131)
Writes data to shared memory. It uses CMD49: Write Extension Register Single Block Command, a command specified by the SD standard.
Returns
SUCCESS
if the command succeeded. If not, it returns
400 Bad Request
.
http://flashair/command.cgi?op=131&ADDR=0&LEN=8&DATA=0123ABCD
0-511
or
0x0-0x1FF
.0-512
or
0x0-0x200
.This operation is available in Firmware Versions 2.00.00+
(op=140)
Returns the number of empty sectors in the FlashAir in the format: Number of empty sectors/Total number of sectors, Sector size (Byte)
http://flashair/command.cgi?op=140
13952920/15228928,512
This example shows that of the card's 15228928 sector capacity, 13952920 sectors are unused. At 512 bytes per sector, this means that 6.7GB of the total 7.26GB (8GB card) remains empty.
This operation is available in Firmware Versions 1.00.03+
(op=190)
Control the I/O pins of the SD Interface as User I/O.
Prerequisites for using this feature is as follows:
IFMODE=1
.
To learn more about
IFMODE
, refer to the article regarding
IFMODE in the CONFIG section.
http://flashair/command.cgi?op=190&CTRL=01f&DATA=0x1f
CTRL
0
for the bits you want to read from, and Set
1
for the bits you want to write to.DATA
0
to output low, or set
1
to output high.
{"STATUS":"OK","CTRL":"0x1f","DATA":"0x1f"}
This operation is available in Firmware Versions 2.00.03+
(op=200)
Enables Photo Share mode. Photo Share mode is used to limit access to data other than in the specified
directory or from
the specified date.
When Photo Share mode is enabled, HTTP GET requests to directories specified by command.cgi are
ignored
and instead data from the directory and date specified by Photo Share mode are returned.
Returns
OK
if command succeeded. If not, it returns
400 Bad Request
http://flashair/command.cgi?op=200&DIR=/DCIM/100__TSB&DATE=17153
For detail regarding parameters, refer to Get file list.
This operation is available in Firmware Versions 2.00.00+
If you use op=200 to enable photo sharing mode, the SSID and network security key will not be changed from the already set contents.
To change the network security key, change the network security key using network security key setting in config.cgi.
To change the SSID, please change the SSID by using SSID setting in config.cgi.
(op=201)
Disables Photo Share mode. Photo Share mode is used to limit access to data other than that in the specified directory or of the specified date.
Returns
OK
if command succeeded. If not, it returns
400 Bad Request
http://flashair/command.cgi?op=201
This operation is available in Firmware Versions 2.00.00+
(op=202)
Returns whether Photo Share mode is enabled or not.
If Photo Share mode is enabled, it returns
SHAREMODE
. If Photo Share mode is disabled, it returns
NORMALMODE
.
http://flashair/command.cgi?op=202
SHAREMODE
This operation is available in Firmware Versions 2.00.00+
(op=203)
Returns a special SSID used for Photo Share mode.
http://flashair/command.cgi?op=203
photoshare_e8e0b756a7fb
This operation is available in Firmware Versions 2.00.00+
(op=220)
Returns whether FlashAir Drive is enabled or not.
0 | Disable FlashAir Drive |
---|---|
1 | Enable FlashAir Drive(read only) |
2 | Enable FlashAir Drive. Needs also
UPLOAD=1 to write files. |
http://flashair/command.cgi?op=220
1
This operation is available in Firmware Versions 3.00.00+
(op=221)
Returns the timezone that will be used to convert from FAT file time to UTC time when FlashAir Drive is
run. The timezone
is stored in 15 minute increments, ranging from
-48
to
54
. For example UTC standard time is
0
, and Japan time (which is 9 hours ahead), is
36
(9(h)×4(15m)=36).
http://flashair/command.cgi?op=221
36
This operation is available in Firmware Versions 3.00.00+